﻿@{
    ViewBag.Title = "Click1";
}

<div>You've clicked <span data-bind="text: numberOfClicks"></span>times   
    <button data-bind="click: incrementClickCounter">Click me</button></div>
<script type="text/javascript">
    var viewModel = {
        numberOfClicks: ko.observable(1),
        incrementClickCounter: function () {
            var previousCount = this.numberOfClicks();
            this.numberOfClicks(previousCount + 1);
        }
    };
    ko.applyBindings(viewModel);

</script>
